/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ch02;

/**
 *
 * @author Administrator
 */
public class MethodSum {
   

    public static void main(String args[]){
        int sum1=sum(100,200);
        System.out.println(sum1);
        int sum2=sum(300,500);
        System.out.println(sum2);
        int sum3=sum(700,900);
        System.out.println(sum3);
        
    }
     public static int sum(int a,int b){
        int s=0;
       for(int i=a;i<=b;i++){
           s=s+i;
       }
       return s;
    }
    
}
